home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 19 / Amiga Plus Leser CD 19.iso / Online / AmigaTalk / intuition / WindowFlags.st < prev    next >
Text File  |  2002-03-15  |  3KB  |  80 lines

  1. " -------------------------------------------------------------------- "
  2. " WindowFlags Class is a Singleton class that allows the user to       "
  3. " reference Window Flags without having to remember their actual       "
  4. " hexadecimal values.                                                  "
  5. ""
  6. " The User does NOT need to create one of these, since Intuition Class "
  7. " will instantiate the only needed instance of this Class.  See the    "
  8. " SetupIntuition.st source file for the method(s) that help the User   "
  9. " with this Class.                                                     "
  10. ""
  11. "   EXAMPLE:  'myTag <- intuition getWindowFlag: #WFLG_SIZEGADGET'     "
  12. ""
  13. " ALL singleton classes MUST contain the following:                    "
  14. ""
  15. "   the methods:  isSingleton AND privateSetup     AND                 "
  16. "                 uniqueInstance Class instance variable.              "
  17. " -------------------------------------------------------------------- "
  18.  
  19. Class WindowFlags :Dictionary ! uniqueInstance !
  20. [
  21.    isSingleton
  22.      ^ true  
  23. |  
  24.    privateNew ! newinstance !
  25.      newinstance <- super new.
  26.  
  27.      ^ newinstance
  28. |
  29.    new
  30.      ^ (self privateSetup)
  31. |
  32.    privateSetup
  33.      (uniqueInstance isNil)
  34.        ifTrue: [uniqueInstance <- self privateNew.
  35.  
  36.                 self at: #WFLG_SIZEGADGET     put: 1.
  37.                 self at: #WFLG_DRAGBAR        put: 2.
  38.                 self at: #WFLG_DEPTHGADGET    put: 4.
  39.                 self at: #WFLG_CLOSEGADGET    put: 8.
  40.  
  41.                 self at: #WFLG_REFRESHBITS    put: 16rC0. "For masking"
  42.                 self at: #WFLG_SIZEBRIGHT     put: 16r10.
  43.                 self at: #WFLG_SIZEBBOTTOM    put: 16r20.
  44.  
  45.                 self at: #WFLG_SMART_REFRESH  put: 0.
  46.                 self at: #WFLG_SIMPLE_REFRESH put: 16r40.
  47.                 self at: #WFLG_SUPER_BITMAP   put: 16r80.
  48.                 self at: #WFLG_OTHER_REFRESH  put: 16rC0.
  49.  
  50.                 self at: #WFLG_BACKDROP       put: 16r100.
  51.                 self at: #WFLG_REPORTMOUSE    put: 16r200.
  52.                 self at: #WFLG_GIMMEZEROZERO  put: 16r400.
  53.                 self at: #WFLG_BORDERLESS     put: 16r800.
  54.  
  55.                 self at: #WFLG_ACTIVATE       put: 16r1000.
  56.  
  57.                 self at: #WFLG_RMBTRAP        put: 16r10000.
  58.                 self at: #WFLG_NOCAREREFRESH  put: 16r20000.
  59.                 self at: #WFLG_NW_EXTENDED    put: 16r40000.
  60.  
  61.                 self at: #WFLG_NEWLOOKMENUS   put: 16r200000.
  62.  
  63.                 self at: #WFLG_VISITOR        put: 16r8000000.
  64.                 self at: #WFLG_ZOOMED         put: 16r10000000.
  65.                 self at: #WFLG_HASZOOM        put: 16r20000000.
  66.  
  67.                "These flags are set only by Intuition.  
  68.                 YOU MAY NOT SET THEM YOURSELF!"
  69.  
  70.                 self at: #WFLG_WINDOWACTIVE   put: 16r2000.
  71.                 self at: #WFLG_INREQUEST      put: 16r4000.
  72.                 self at: #WFLG_MENUSTATE      put: 16r8000.
  73.                 self at: #WFLG_WINDOWREFRESH  put: 16r1000000.
  74.                 self at: #WFLG_WBENCHWINDOW   put: 16r2000000.
  75.                 self at: #WFLG_WINDOWTICKED   put: 16r4000000.
  76.                ].
  77.                
  78.      ^ self "uniqueInstance??"
  79. ]
  80.